﻿changeTexts(fl.getDocumentDOM());

function changeTexts(doc){	
	var typeToSearchFor = "text"; 
	var results = fl.findObjectInDocByType(typeToSearchFor, doc); 
	if (results.length > 0) { 
		for (var i = 0; i < results.length; i++) { 
			results[i].obj.autoExpand = false;
			results[i].obj.setTextString("");
			results[i].obj.setTextAttr("face", "Arial");
			results[i].obj.setTextAttr("lineSpacing", "0");
			results[i].obj.embedRanges = "";
			results[i].obj.setTextAttr("autoKern", false);
			results[i].obj.fontRenderingMode = 'advanced';
			results[i].obj.scaleX = 1;
			results[i].obj.scaleY = 1;
		} 
		alert("success, found " + results.length + " objects");
	} 
	else {  
		alert("failed, no objects of type " + typeToSearchFor + " found"); 
	}
}